package com.zlx.rulemk.marketing.utils;

import com.zlx.rulemk.marketing.beans.PropertiesBean;
import com.zlx.rulemk.marketing.constant.PropertiesCompar;
import com.zlx.rulemk.marketing.constant.PropertiesValueType;
import lombok.extern.slf4j.Slf4j;


/**
 * @Author: zhanglingxing
 * @CreateTime: 2022-07-06
 * @Description: 属性比较器 具体实现方式
 * @Version: 1.0
 * TODO 这个类可以后期随便扩展，目前就写一个eq的比较即可~
 */
@Slf4j
public class ComparPropertiesUtils {


    public static boolean ComparProperAchieve(String eventValue, PropertiesBean ruleProp) {

        // String 类型的 eq比较
        if(ruleProp.getComparMethod().equals(PropertiesCompar.eq)
                && ruleProp.getValueType().equals(PropertiesValueType.str)
        ){
            return eventValue.equals(ruleProp.getRuleValue());
        }

        return false;
    }




}
